package com.tenbent.product.center.insures.bo;

import com.tenbent.product.base.bo.BizObject;
import com.tenbent.product.base.mybatis.annotations.TypeAlias;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * Sku对应价格
 *
 * @author Randy
 *
 *         Created by ThinkPad on 2017/8/21.
 */
@Entity
@Table(name = "pc_sku_price")
@TypeAlias("skuPrice")
public class SkuPrice extends BizObject {

	/** 产品ID **/
	@Column(name = "product_id")
	private Integer productId;

	/** sku值组合，下划线（_）拼接 **/
	@Column(name = "risk_values")
	private String riskValues;

	/** 单位价格 **/
	@Column(name = "unit_price")
	private BigDecimal unitPrice;

	/** 总价格 **/
	@Column(name = "total_price")
	private BigDecimal totalPrice;

	public Integer getProductId() {
		return productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	public String getRiskValues() {
		return riskValues;
	}

	public void setRiskValues(String riskValues) {
		this.riskValues = riskValues;
	}

	public BigDecimal getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

	public BigDecimal getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		SkuPrice skuPrice = (SkuPrice) o;

		if (productId != null ? !productId.equals(skuPrice.productId) : skuPrice.productId != null)
			return false;
		if (riskValues != null ? !riskValues.equals(skuPrice.riskValues) : skuPrice.riskValues != null)
			return false;
		if (unitPrice != null ? !unitPrice.equals(skuPrice.unitPrice) : skuPrice.unitPrice != null)
			return false;
		return totalPrice != null ? totalPrice.equals(skuPrice.totalPrice) : skuPrice.totalPrice == null;

	}

	@Override
	public int hashCode() {
		int result = productId != null ? productId.hashCode() : 0;
		result = 31 * result + (riskValues != null ? riskValues.hashCode() : 0);
		result = 31 * result + (unitPrice != null ? unitPrice.hashCode() : 0);
		result = 31 * result + (totalPrice != null ? totalPrice.hashCode() : 0);
		return result;
	}

	@Override
	public String toString() {
		return "SkuPrice{" + "productId=" + productId + ", riskValues='" + riskValues + '\'' + ", unitPrice="
				+ unitPrice + ", totalPrice=" + totalPrice + '}';
	}
}
